{% set element = element|default('div') %}
{% set attributes = attributes|default(create_attribute()) %}
{% set svg_size = svg_size|default('default') %}
{% if url is not empty %}
  {% set attributes = attributes.setAttribute('href', url) %}
  {% set element = 'a' %}
{% endif %}
{%- set content = content|render -%}
<{{ element }} {{ attributes.addClass([
  'wsc-component', 'px-4', 'py-2', 'leading-18', 'font-serif', 'uppercase', 'inline-block',
  variant == 'primary' ? 'bg-primary text-white',
  variant == 'secondary' ? 'bg-secondary text-white',
  variant == 'success' ? 'bg-success text-white',
  variant == 'warning' ? 'bg-warning text-white',
  variant == 'disabled' ? 'bg-disabled text-gray-xmedium',
  color,
] | sort | join(' ') | trim) }}>
{{ content|striptags }}
  {% if svg is not empty %}

    {% include "@atoms/svg/_svg--icon.twig" with {
      icon: svg,
      size: size,
      svg_classes: ['inline-block', 'align-middle', content|striptags ? 'ml-15', variant == 'outline' ? 'fill-red' : 'fill-white']
    } %}
  {% endif %}
</{{ element }}>
